package com.gome.axwl.aoc.standalone.config;

import com.cloudzone.cloudoss.api.impl.OSSBean;
import com.cloudzone.cloudoss.api.open.OSS;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Properties;

@Configuration  
public class CloudossConfig {
    
    @Value("${myOssConfig.ossMetaName}")
    private String appMetaName;
    
    @Value("${myOssConfig.ossAuthKey}")
    private String authKey;

    @Bean
    public OSS ossBean() {
        OSSBean ossBean = new OSSBean();
        Properties properties = new Properties();
        properties.setProperty("appMetaName", appMetaName);
        properties.setProperty("authKey", authKey);
        ossBean.setProperties(properties);
        ossBean.init();
        return ossBean;
    }
}
